﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td height="7" colspan="2">
        </td>
    </tr>
    <tr>
        <td colspan="2" class="style2">
            <strong>Danh m&#7909;c:</strong>
        </td>
    </tr>
    <tr align="left">
        <td style="width: 50%" valign="top">
            <%if (ViewData["MasterCategory"] != null)
              {
                  List<Category> listCategory = (List<Category>)ViewData["MasterCategory"];
                  if (listCategory.Count > 0)
                  {
                      double ext = listCategory.Count % 2;
                      int index = listCategory.Count / 2;
                      if (ext != 0)
                      {
                          index += 1;
                      }
                      for (int i = 0; i < index; i++)
                      {

                          Category obj = listCategory[i];
                          if (i <= index - 1)
                          {
                              Response.Write("<a href=" + FRouter._("danhmuc", obj.ID.ToString(), obj.CategoryName) + " class='textlink4'>" + obj.CategoryName + "</a><br />");
                          }
                          else
                          {
                              Response.Write("<a href=" + FRouter._("danhmuc", obj.ID.ToString(), obj.CategoryName) + " class='textlink4'>" + obj.CategoryName + "</a>");
                          }
                      }
            %>
        </td>
        <td style="width: 50%" valign="top">
            <%for (int y = index; y < listCategory.Count; y++)
              {
                  Category obj = listCategory[y];
                  if (y <= listCategory.Count - 1)
                  {
                      Response.Write("<a href=" + FRouter._("danhmuc", obj.ID.ToString(), obj.CategoryName) + " class='textlink4'>" + obj.CategoryName + "</a><br />");
                  }
                  else
                  {
                      Response.Write("<a href=" + FRouter._("danhmuc", obj.ID.ToString(), obj.CategoryName) + " class='textlink4'>" + obj.CategoryName + "</a>");
                  }
              }
                  }
              }%>
        </td>
    </tr>
    <tr>
        <td height="7" colspan="2">
        </td>
    </tr>
</table>
